Image correction apparatus and method, and image correction program

ABSTRACT

Which types of subject among a predetermined plurality of types of subject are contained in an image represented by input image data are detected. Features regarding the detected subject types are calculated in a feature calculating circuit based upon the image data. In accordance with the features calculated, the gain for every subject type is calculated. The gains are weighted and averaged using degrees of importance that have been input for every subject type. The input image data is corrected based upon applicable gains obtained by the weighted averaging.

TECHNICAL FIELD

This invention relates to an image correction apparatus and method andto an image correction program.

BACKGROUND ART

Japanese Patent Application Laid-Open No. 2000-196890 discloses a methodof detecting a face image area contained in an input image andperforming an image conversion (image correction) in such a manner thatthe average density of the detected face image will fall within apredetermined target density range.

Although the density of the face image area can be corrected to adensity within the target density range using the method described inJapanese Patent Application Laid-Open No. 2000-196890, the densities ofother types of important subjects, such as blue sky or a sunset scene,cannot be corrected to a desired density.

DISCLOSURE OF THE INVENTION

Accordingly, an object of the present invention is to so arrange it thatan appropriate image correction can be applied with regard to an imagein which a plurality of subject types exist.

Another object of the present invention is to apply a correction to animage in which a plurality of subject types exist in such a manner thata desired image color (brightness) is obtained for the image as a whole.

An image correction apparatus according to a first aspect of the presentinvention comprises: importance input means for accepting inputs ofdegrees of importance regarding respective ones of a plurality ofsubject types; subject-type detecting means for detecting, based uponimage data applied thereto, which subject types among a predeterminedplurality of subject types are contained in the image represented bythis image data; input feature value calculating means for calculating,based upon the image data and with regard to respective ones of thesubject types detected by the subject-type detecting means, inputfeature values by calculation processing decided for every subject type;correction value calculating means for calculating correction valuesregarding respective ones of the subject types based upon the inputfeature values calculated by the input feature value calculating meansand target feature values that has been decided for every subject type;applicable-correction-value calculating means for calculating anapplicable correction value obtained by weighted averaging of thecorrection values, which have been calculated by the correction valuecalculating means, using the degrees of importance accepted with regardto respective ones of the subject types by the importance input means;and image correcting means for correcting the image data based upon theapplicable correction value calculated by theapplicable-correction-value calculating means.

A plurality of subject types to be detected are determined in advance.Set as the subject types are a plurality of types of subjects (which mayalso be referred to as types of photographic scenes) identifiable basedupon the image data, these types of subject being set in order toundergo different corrections in image correction (it is known fromexperience that executing different correction processing results in acorrected image that is appropriate). For example, “blue sky”, “humanface”, “underwater”, “high saturation”, “sunset scene” and “high key”can be set as the plurality of subject types.

Processing (subject-type detection processing) for detecting which ofpredetermined subject types are contained in an image represented byapplied image data can be executed using data for identification set inadvance with regard to respective ones of the subject types. Forexample, a plurality of items of image data (blue-sky sample images)representing the subject type “blue sky” are prepared and an appropriateidentification condition [feature type and range thereof (hue range,luminance range, saturation range, etc.)] is calculated in order toextract blue-sky pixels from each of these samples images (this islearning processing). One or a plurality of feature values are extractedfrom the applied image data. If the extracted one or plurality offeature values are in line with the identification condition obtainedfrom learning processing, then it is judged that the image representedby the applied image data contains the subject type “blue sky”.

Input feature values that have been decided on a per-subject-type basisare calculated based upon the image data in regard to respective ones ofthe feature types detected. The input feature values are feature values(quantities) specific to the subject types with regard to respectiveones of the subject types, and processing for calculating these differsfor every subject type. For example, if the subject type is “blue sky”,average values of respective ones of R, G, B values of pixels (blue-skypixels) of a blue-sky image portion contained in the image representedby the applied image data can be adopted as input feature valuesregarding the subject type “blue sky”. If the subject type is “sunsetscene”, then average values of respective ones of R, G, B values ofpixels [sunset-scene (orange) pixels] of a sunset-scene image portioncontained in the image represented by the applied image data can beadopted as input feature values regarding the subject type “sunsetscene”. In any case, the method of calculating the input featurevalue(s) need only be decided for every subject type in accordance withthe features of an image represented by a predetermined plurality ofsubject types.

A correction value is a value for correcting an input feature value to atarget feature value. By correcting an input feature value, which isobtained from the applied image data, to a target feature value, animage having the desired (target) feature can be obtained. If an inputfeature value is corrected in accordance with a correction value, theinput feature value becomes the target feature value. Correction valuesthat may be calculated include various correction values that can beused in image correction, e.g., a density (luminance) grayscalecorrection value, saturation correction value and other correctionvalues. The ratio (gain) between an input feature value and a targetfeature value also is included in correction values found according tothe present invention.

In accordance with the present invention, applicable correction valueapplied to image data are the result of weighted averaging, based upondegrees of importance of every subject type, the correction valuesobtained with regard to respective ones of the detected subject types(i.e., subject types contained in the image represented by the imagedata to be processed). The correction value obtained for every subjecttype corrects the input feature value, which is based upon the appliedimage data, to a target feature value. Since the plurality of correctionvalues calculated with regard to respective ones of the detectedplurality of subject types are weighted and averaged with regard to thedegrees of importance received, the applicable correction value appliedto the image data are such that input feature values of the respectiveplurality of subject types approach overall the target feature valuescorresponding to the input feature values. The color (or brightness) ofthe applied image can be corrected to a desired image color (orbrightness) in terms of the overall image.

In accordance with the present invention, an input feature value cannotbe made to perfectly coincide with a target feature value when attentionis directed toward each individual feature type. However, with regard toan image in which a plurality of subject types are contained, an imagecorrection whereby the input feature values approach the target featurevalues reliably can be executed with regard to any of the plurality ofsubject types.

Further, in accordance with the present invention, degrees of importanceapplied with regard to respective subject types are used in thecalculation of weighted average. It is possible to obtain an applicablecorrection value that greatly reflects a correction value regarding asubject type that the user regards as important. As a result, anapplicable correction value for implementing an image correctionconforming to user preference can be obtained.

Correction values and applicable correction value may be specific torespective ones of color image data (e.g., RGB) of a plurality of colorsor may be shared by respective ones of color image data of a pluralityof colors.

In one embodiment, the apparatus further comprises subject type-by-typeexistence-probability calculating means for calculating existenceprobabilities representing to what degrees of confidence respective onesof images representing the plurality of subject types are contained inthe image represented by the image data, the calculation being performedfor every subject type of the plurality thereof. In this case,applicable-correction-value calculating means weights and averages thecorrection values regarding respective ones of the subject types, whichhave been calculated by the correction value calculating means, usingthe first degrees of importance and second degrees of importanceobtained in accordance with the existence probabilities of respectiveones of the subject types calculated by the existence-probabilitycalculating means.

The second degree of importance conforming to existence probability isused in weighted averaging in addition to the first degree of importancethat is input. An image correction conforming to the content of theapplied image data (probability of existence a subject type) istherefore achieved while user preference is satisfied.

In another embodiment, the apparatus further comprises subjecttype-by-type area calculating means for calculating, for every detectedsubject type, the area that an image representing the subject typeoccupies in the image represented by the image data. Theapplicable-correction-value calculating means weights and averages thecorrection values of respective ones of the subject types, which havebeen calculated by the correction value calculating means, using thefirst degrees of importance and third degrees of importance obtained inaccordance with the areas regarding respective ones of the subject typescalculated by the area calculating means. An image correction conformingto the area of a subject type that occupies the image represented by theapplied image data is therefore achieved while user preference issatisfied.

Preferably, the image correction apparatus further comprises parameterinput means for accepting input of a parameter that changes the targetfeature value; and target feature modifying means for modifying thetarget feature value based upon the parameter input by the parameterinput means. Since a target feature value is modified in accordance withthe wish of the user, the image represented by the image data after thecorrection thereof can be made to conform to user preference. Theparameter that is input may be accepted in the form of a numerical valueor in the form of an abstract expression (which emphasizes quality orproductivity, etc.).

An image correction apparatus according to a second aspect of thepresent invention comprises: importance input means for accepting inputsof degrees of importance regarding respective ones of a predeterminedplurality of subject types; subject-type detecting means for detecting,based upon image data applied thereto, which subject types among aplurality of subject types are contained in the image represented bythis image data; input feature value calculating means for calculating,based upon the image data and with regard to respective ones of thesubject types detected by the subject-type detecting means, inputfeature values by calculation processing decided for every subject type;condition judging means for judging whether the input feature value ofevery subject type calculated by the input feature calculating meanssatisfies a prescribed condition that has been decided for every subjecttype; correction value calculating means for calculating a correctionvalue with regard to a subject type for which the input feature valuehas been judged not to satisfy the prescribed condition by the conditionjudging means, the correction value being such that the input featureregarding this subject type will come to satisfy the prescribedcondition; applicable-correction-value calculating means for calculatingapplicable correction value obtained by weighted averaging of thecorrection values, which have been calculated by the correction valuecalculating means, using the degrees of importance accepted with regardto respective ones of the subject types by the importance input means;and image correcting means for correcting the image data based upon theapplicable correction value calculated by theapplicable-correction-value calculating means.

In accordance with the second aspect of the present invention, acorrection value is calculated based upon whether or not an inputfeature value for every detected subject type satisfies a prescribedcondition. In a case where an input feature value regarding one detectedsubject type satisfies the prescribed condition, it is not necessary tocorrect the input feature value regarding this one subject type. If aninput feature value regarding one detected subject type does not satisfythe prescribed condition, then a correction value for which theprescribed condition will be satisfied is calculated with regard to thisone subject type. The prescribed conditions also can be decided bylearning processing executed in advance.

In the second aspect of the present invention as well, a calculatedplurality of correction values are weighted and averaged based uponaccepted degrees of importance, and therefore the applicable correctionvalue applied to the image data corrects the image data in such a mannerthat, with regard to subject types for which input feature values thatdo not satisfy prescribed conditions have been calculated, these inputfeature values will come to approach the prescribed conditions. An imagecorrection conforming to user preference is achieved. The color (orbrightness) of the applied image can be corrected to a desired imagecolor (or brightness) in terms of the overall image.

Preferably, the image correction apparatus further comprises parameterinput means for accepting input of a parameter that changes theprescribed condition; and condition modifying means for modifying theprescribed condition based upon the parameter input by the parameterinput means.

The present invention also provides image correction methods and imagecorrection programs corresponding to the first and second imagecorrection apparatuses described above.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the hardware configuration of animage correction system;

FIG. 2 is a block diagram illustrating the electrical structure of animage correction apparatus according to a first embodiment;

FIG. 3 is a functional block diagram illustrating the functions of asubject-type detecting circuit, a subject type-by-type inputfeature-value calculating circuit and a subject type-by-type targetfeature-value/color-conversion-condition calculating circuit;

FIG. 4 is a flowchart illustrating the flow of processing executed bythe subject-type detecting circuit, subject type-by-type inputfeature-value calculating circuit and subject type-by-type targetfeature-value/color-conversion-condition calculating circuit with regardto the subject type “blue sky”;

FIG. 5 illustrates the content of a detection condition table;

FIG. 6 illustrates a blue-sky extraction condition in the form of agraph;

FIG. 7 illustrates the content of a table of feature value calculationconditions;

FIG. 8 illustrates a boundary function regarding the subject type “bluesky”

FIG. 9 illustrates a boundary function regarding the subject type “bluesky”

FIG. 10 illustrates a correction function;

FIG. 11 a illustrates correction functions regarding the feature type“night scene” (shadow), the feature type “night scene” (highlight) andthe feature type “face”, and FIG. 11 b illustrates a correction functiondecided by applicable gain;

FIG. 12 illustrates an example of a screen for inputting a user's wish;

FIG. 13 is a block diagram illustrating the electrical structure of animage correction apparatus according to a modification of the firstembodiment;

FIG. 14 is a block diagram illustrating the electrical structure of animage correction apparatus according to a second embodiment;

FIG. 15 is a functional block diagram illustrating the functions of asubject type-by-type existence-probability calculating circuit, asubject type-by-type input feature calculating circuit and a subjecttype-by-type target feature calculatingcircuit/color-conversion-condition calculating circuit;

FIG. 16 illustrates the content of an existence-probability calculationtable;

FIG. 17 illustrates the flow of creation of the existence-probabilitycalculation table; and

FIG. 18 is a graph illustrating the relationship between existenceprobability and degree of importance corresponding to existenceprobability.

BEST MODE FOR CARRYING OUT THE INVENTION First Embodiment

FIG. 1 is a block diagram illustrating the hardware configuration of animage processing system. FIG. 2 is a block diagram illustrating theelectrical structure of an image processing apparatus 1, which isincluded in the image processing system, together with a storage unit 4.

The image processing system comprises the image processing apparatus 1,an input unit 2 (keyboard, mouse, etc.) connected to the imageprocessing apparatus 1, a display unit 3 (CRT display, liquid crystaldisplay, etc.), the storage unit 4 (hard disk, etc.) and a printer 5.

Image data has been stored in the storage unit 4 connected to the imageprocessing apparatus 1. Image data that has been specified by the inputunit 2 is read out of the storage unit 4 and is input to the imageprocessing apparatus 1 via an input interface (not shown) (Image datathat is input to the image processing apparatus 1 shall be referred toas “input image data” below, and an image represented by input imagedata shall be referred to as an “input image” below.) It may of coursebe so arranged that image data that has been recorded on a CD-ROM,DVD-ROM, memory card or other recording medium instead of the storageunit 4 is input to the image processing apparatus 1. In this case, aCD-ROM drive or DVD-ROM drive, etc., is connected to the imageprocessing apparatus 1 of the image processing system. It may be soarranged that image data that has been transmitted through a network isinput to the image processing apparatus 1. In this case, a transceiver(modem, etc.) for sending and receiving image data over a network isconnected to the image processing apparatus 1.

The image processing apparatus 1 has a subject-type detecting circuit11, a subject type-by-type input feature-value calculating circuit 12, asubject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13, a color-conversion-condition synthesizingcircuit 14 and an image correcting circuit 15.

The subject-type detecting circuit 11 is a circuit for detecting(identifying) subject types contained in an input image represented byinput image data. Input image data that has been input to the imageprocessing apparatus 1 is applied first to the subject-type detectingcircuit 11. In the first embodiment, the subject-type detecting circuit11 detects whether each of the seven subject types “blue sky”, “sunsetscene”, “face”, “high saturation”, “underwater”, “high key” and “nightscene” is contained in the input image. A detection condition table 21is connected to the subject-type detecting circuit 11. On the basis ofdata that has been stored in the detection condition table 21, whichsubject types are contained in the input image are detected in thesubject-type detecting circuit 11. The processing by the subject-typedetecting circuit 11 and the content of the detection condition table 21will be described in detail later.

The subject type-by-type input feature-value calculating circuit 12 is acircuit for calculating prescribed feature value (e.g., average RGBvalues, RGB dispersion values, etc.) specific to respective subjecttypes regarding an input image represented by input image data. Featurevalue calculated in the subject type-by-type input feature-valuecalculating circuit 12 using the input image data shall be referred toas “input feature value” below. A feature-value calculation table 22 isconnected to the subject type-by-type input feature-value calculatingcircuit 12. The subject type-by-type input feature-value calculatingcircuit 12 calculates an input feature value specific to every featuretype by referring to the feature-value calculation table 22. Processingby the subject type-by-type input feature-value calculating circuit 12and the content of the feature-value calculation table 22 will bedescribed in detail later.

The subject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13 is a circuit for calculating a target featurevalue (e.g., RGB value) for every subject type. A target feature valuevaries depending upon the input feature value calculated in the subjecttype-by-type input feature-value calculating circuit 12 and a parameter(referred to as an “input parameter” below) that is input by theoperator (user) of the image processing system using the input unit 2.

By calculating (deciding) a target feature value, the ratio between thetarget feature value (e.g., RGB value) and an input feature value (e.g.,RGB value) is adopted as the gain of the subject type (gain coefficientsregarding respective R, B, G components are obtained). The subjecttype-by-type target feature-value/color-conversion-condition calculatingcircuit 13 can be referred to as a circuit that calculates (decides) atarget feature value corresponding to the input feature value, therebycalculating gains regarding respective subject types detected by thesubject-type detecting circuit 11.

A boundary function table 23 in which data representing boundaryfunctions decided for each of the subject types has been stored isconnected to the subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13. Targetfeature values (gains) are calculated (decided) based upon the boundaryfunction table 23. Processing by the subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13 and thecontent of the boundary function table 23 will be described in detaillater.

The color-conversion-condition synthesizing circuit 14 is a circuit forcalculating one gain (for each of R, G, B) based upon gains (gaincoefficients regarding respective R, G, B components), which have beenobtained in the subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13,regarding each of the subject types that have been detected, and adegree Wi of importance, which is input by the operator (user) of theimage processing system using the input unit 2, regarding each of thesubject types. The details of processing by thecolor-conversion-condition synthesizing circuit 14 will be describedlater.

The image correcting circuit 15 is a circuit for correcting (converting)the RGB values of each of the pixels constituting the input image basedon gain (applicable gain coefficients) calculated by thecolor-conversion-condition synthesizing circuit 14.

FIG. 3 is a functional block diagram illustrating the functions of thesubject-type detecting circuit 11, the subject type-by-type inputfeature-value calculating circuit 12 and the subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13.

In the first embodiment, “subject type” is a generic term that refers toseven types of subjects (photographic scenes), namely “blue sky”,“sunset scene”, “face”, “high saturation”, “underwater”, “high key” and“night scene”, as mentioned above. On the basis of image data to beprocessed read out of the storage unit 4, whether the image representedby this image data contains these seven types of subjects is detected inthe subject-type detecting circuit 11 (function blocks 11 a to 11 g).

The subject type-by-type input feature-value calculating circuit 12 isadapted so as to be able to calculate input feature values regardingrespective ones of the seven subject types “blue sky”, “sunset scene”,“face”, “high saturation”, “underwater”, “high key” and “night scene”(function blocks 12 a to 12 g). Which values are used as input featurevalues differ on a per-subject-type basis. Definitions as to whichvalues are used as input feature values have been stored in thefeature-value calculation table 22 (described later).

The target feature values (gains) corresponding to the input featurevalues of every subject type calculated in the subject type-by-typeinput feature-value calculating circuit 12 are calculated (decided) inthe subject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13 (function blocks 13 a to 13 g).

Gains (Gri, Ggi, Gbi) calculated for every detected subject type aresupplied from the subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13 to thecolor-conversion-condition synthesizing circuit 14 (see FIG. 2), wherebya single gain (applicable gain) is calculated.

The processing (processing by function blocks 11 a, 12 a and 13 a)executed by the subject-type detecting circuit 11, subject type-by-typeinput feature-value calculating circuit 12 and subject type-by-typetarget feature-value/color-conversion-condition calculating circuit 13will now be described with attention being directed to the subject type“blue sky”, which is one of the subject types capable of being detectedby the image processing apparatus 1 of the first embodiment.

FIG. 4 is a flowchart illustrating the flow of processing executed bythe subject-type detecting circuit 11, subject type-by-type inputfeature-value calculating circuit 12 and subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13 withregard to the subject type “blue sky” (function blocks 11 a, 12 a and 13a).

Image data (input image data) to be processed is read out of the storageunit 4. The input image data read out is applied to the subject-typedetecting circuit 11 (step 31).

The subject-type detecting circuit 11 refers to the detection conditiontable 21. FIG. 5 illustrates the content of the detection conditiontable 21.

Data representing pixel extraction conditions and data representingdetection conditions regarding respective ones of subject types havebeen stored in the detection condition table 21. A set composed of apixel extraction condition and a detection condition regarding thesubject type “blue sky” is used in a blue-sky detecting function 11 a.

Pixel extraction conditions that have been stored in the detectioncondition table 21 decide conditions for extracting pixels representingrespective ones of the subject types from among the pixels constitutingthe input image.

Data (a blue-sky pixel extraction condition) representing the pixelextraction condition that has been decided with regard to the subjecttype “blue sky” will now be described.

In the first embodiment, a blue-sky pixel is assumed to be a pixel thatsatisfies the following equation among the pixels constituting the inputimage:308°≦H≦351°S≧0.25SmaxY≧0.25YmaxYmaxS≧(Ymax−Y)Smax  Equation 1

Here H, S and Y represent hue, saturation and luminance, respectively.Luminance Y is calculated based upon RGB values of each pixel accordingto the following equation;Y=(19R+38G+7B)/64  Equation 2

Further, saturation S is calculated based upon the RGB values of eachpixel according to the following equation:S=SQRT(Cr ² +Cb ²)  Equation 3

Here Cr, Cb in Equation 3 are calculated according to the followingequations:Cr=R−YCb=B−Y  Equation 4

Further, Ymax and Smax in Equation 1 represent maximum luminance andmaximum saturation, respectively, in the overall input image.

FIG. 6 illustrates a blue-sky pixel extraction condition (blue-sky pixelextraction condition .dat) (Equation 1 cited above) in the form of agraph in which luminance Y and saturation S are plotted along thevertical and horizontal axes, respectively. Pixels that belong to a zonedecided by Equation 1, namely pixels that belong to the zone indicatedby the hatching in FIG. 6, are extracted pixels (referred to as a “bluesky pixels” below) regarding the subject type “blue sky”, this pixelsbeing among the pixels constituting the input image. On the basis of theblue-sky pixel extraction condition that has been stored in thedetection condition table 21, blue-sky pixels are extracted from amongthe pixels constituting the input image (step 32).

The number of blue-sky pixels that have been extracted based upon theblue-sky pixel extraction condition in the detection condition table 21is calculated and the ratio of the calculated number of blue-sky pixelsto the total number of pixels is calculated (step 33).

It is determined whether the ratio of the calculated number of blue-skypixels to the total number of pixels, i.e., the proportion (area ratio)of the input image occupied by the blue-sky pixels, is equal to orgreater than a prescribed value (step 34). To make this determination,reference is had to the detection condition regarding the subject type“blue sky” stored in the detection condition table 21.

With reference to FIG. 5, the detection condition regarding the subjecttype “blue sky” is blue-sky area ratio Asky≧0.01. Hence, with regard tothe subject type “blue sky”, it is determined whether the number ofblue-sky pixels (the area ratio) is in line with this condition.

If the blue-sky area ratio Asky is less than the prescribed value(blue-sky area ratio Asky<0.01), then the input image represented by theinput image data is handled as not being an image that contains thesubject type “blue sky” (“NO” at step 34; step 35). In this case, dataindicative of the fact that the input image does not contain a blue-skyimage is supplied from the subject-type detecting circuit 11 to thesubject type-by-type input feature-value calculating circuit 12 andsubject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13. In this case, the subject type-by-type inputfeature-value calculating circuit 12 and subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13 do notexecute processing regarding the subject type “blue sky”. That is, atarget feature value (gain) regarding the subject type “blue sky” is notcalculated.

If the blue-sky area ratio Asky is equal to or greater than theprescribed value (blue-sky area ratio Asky≧0.01) (“YES” at step 34),then the input image is handled as an image containing the subject type“blue sky”.

Pixel extraction conditions and detection conditions can be set bylearning processing. For example, a plurality of images (blue-sky sampleimages) for which the subject type is to be judged as being “blue sky”are prepared, and a feature value and range(s) thereof (e.g., hue range,luminance range, saturation range, area ratio, etc.) extracted in commonfrom the plurality of blue-sky sample images are derived. The pixelextraction condition and detection condition are decided based upon thederived feature value and range thereof. Of course, it may be soarranged that the conditions (pixel extraction condition and detectioncondition) obtained by learning processing may be revised manually.

In the case where the input image is an image containing the subjecttype “blue sky”, the processing set forth below is executed in thesubject type-by-type input feature-value calculating circuit 12 andsubject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13.

The input image data is applied to the subject type-by-type inputfeature-value calculating circuit 12. By referring to the feature-valuecalculation table 22, the subject type-by-type input feature valuecalculating circuit 12 calculates the feature value(s) that has beendecided with regard to the subject type “blue sky” (this is processingexecuted by blue-sky input feature value calculating function 12 a).

FIG. 7 illustrates the content of the feature-value calculation table22.

Definitions relating to feature values to be calculated have been storedin the feature calculation table 22 in regard to respective subjecttypes. In accordance with the definitions that have been stored in thefeature-value calculation table 22, the subject type-by-type inputfeature-value calculating circuit 12 calculates the feature values ofeach of the subject types based upon the input image data.

With reference to FIG. 7, the fact that average values of each of thecolors R, G, B of blue-sky pixels are calculated as a feature valuecalculation condition is defined in the feature-value calculation table22. The subject type-by-type input feature-value calculating circuit 12calculates average values (Rave, Gave, Bave) of the respective colors R,G, B regarding blue-sky pixels in the image represented by the inputimage data (the blue-sky pixels that have been detected in thesubject-type detecting circuit 11 are used) (step 36).

The calculated RGB average values (Rave, Gave, Bave) of the blue-skypixels are applied to the subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13 as theinput feature value.

The subject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13 calculates the target feature value (gain) on aper-subject-type basis based upon the input feature value calculated inthe subject type-by-type input feature-value calculating circuit 12 andboundary function data decided for every subject type and stored in theboundary function table 23. The processing set forth below is executed.

Saturation S and luminance Y are calculated from the input feature value(Rave, Gave, Bave) regarding the subject type “blue sky” (step 37).Saturation S is calculated based upon Equations 3 and 4 cited above.Luminance Y is calculated based upon Equation 2 cited above.

With regard to the feature type “blue sky”, the subject type-by-typetarget feature-value/color-conversion-condition calculating circuit 13calculates the target feature value and gain based upon the boundaryfunction data regarding the subject type “blue sky” stored in theboundary function table 23 as well as saturation S and luminance Ycalculated from the input feature value (Rave, Gave, Bave) regarding thesubject type “blue sky”.

FIG. 8 illustrates a boundary function, which is represented by boundaryfunction data regarding the subject type “blue sky”, in the form of agraph in which luminance Y and saturation S are plotted along thevertical and horizontal axes, respectively. A boundary function Fsky(s)regarding the subject type “blue sky” has been found experimentally withregard to the subject type “blue sky”.

By way of example, assume that a plotted point in accordance withsaturation S and luminance Y obtained from the input feature value(Rave, Gave, Bave) is the position of a point A (Sa,Ya) in the functiongraph illustrated in FIG. 8. The point A (Sa,Ya) is situated in an outerarea defined by the boundary function Fsky(S). In this case, the subjecttype “blue sky” has sufficient brightness even if not corrected. Withregard to the subject type “blue sky”, therefore, it is judged thatthere is no particular need to execute correction processing. That is,it is construed that the target feature value is equal to the inputfeature value. Gain Gsky regarding the subject type “blue sky” becomes“1” (“NO” at step 38).

Assume that a plotted point in accordance with saturation S andluminance Y obtained from the input feature value (Rave, Gave, Bave) isthe position of a point B (Sa,Ya) in the function graph illustrated inFIG. 8. The point B (Sb,Yb) is situated in an inner area defined by theboundary function Fsky(S). In this case, the input image containing thesubject type “blue sky” will appear dark if the input feature value(Rave, Gave, Bave) is used as the target feature value as is (i.e., gainGsky=1). In this case, the intersection (St,Yt) between the boundaryfunction Fsky(S) and a straight line connecting the origin (0,0) and theplotted point B (Sb,Yb) obtained from the input feature value (Rave,Gave, Bave) is found. The gain Gsky regarding the subject type “bluesky” is found according to the following equation (“YES” at step 38;step 39):Gsky=St/Sb  Equation 5

Thus, gain Gsky regarding the subject type “blue sky” is calculatedusing the boundary function Fsky(s). It can be said that the boundaryfunction Fsky(s) represents a condition stipulating whether or not acorrection should be applied to the subject type “blue sky”. Further, ifthe correction should be performed, it can be said that the function isone that stipulates the correction value (gain).

With regard to the subject type “blue sky”, the gain Gsky obtainedaccording to Equation 5 is adopted as the common gain regarding each ofR, G, B. The target feature value regarding the subject type “blue sky”is (Gsky·Rave, Gsky·Gave, Gsky·Bave).

The target feature value may be determined in advance on aper-subject-type basis as a matter of course. In this case, a correctionvalue (gain) is calculated using the predetermined target feature valueand the calculated input feature value.

The boundary function (target feature value) mentioned above can bechanged by a parameter that is input using the input unit 2. FIG. 9illustrates the manner in which the boundary function Fsky(S) regardingthe subject type “blue sky” is changed.

In a case (strong brightness correction) where it is desired to correctthe subject type “blue sky” by making it brighter, a data inputindicating “intensify brightness of subject type ‘blue sky’” is madeusing the input unit 2. For example, the degree of the brightnesscorrection is input by using a mouse or the like to slide a slide bardisplayed on the display screen of the display unit 3.

If the operator makes the above-described input to brighten the subjecttype “blue sky”, the boundary function Fsky regarding “blue sky” storedin the boundary function table 23 is changed to the function indicatedby the one-dot chain line shown in FIG. 9. If the saturation S andluminance Y obtained from the input feature value are situated on theinner side of the boundary line indicated by the one-dot phantom line,then a gain Gsky (>1) that will correct this plotted point to lie on theboundary function indicated by the one-dot chain line is calculated.Conversely, if the operator attempts to make the subject type “blue sky”darker than the standard, the input unit 2 is used to make an inputindicating “weaken brightness of subject type ‘blue sky’”. The boundaryfunction Fsky is changed to the function indicated by the two-dotphantom line.

FIG. 10 illustrates a correction function (a straight gain line) towhich gain Gsky has been applied. In FIG. 10, the phantom line indicatesa correction function for when gain is “1”, and the solid line indicatesa correction function to which gain Gsky (>1) has been applied.

With regard to the subject type “blue sky”, the photographic scene isone that is shot outdoors. Accordingly, gain Gsky that is common withregard to each of R, G, B is found without taking white balance intoconsideration. With regard to another feature type, e.g., the featuretype “face”, it may be so arranged that gain (the target feature value)is calculated separately with regard to each of R, G, B taking whitebalance into consideration (the ratio among R, G, B is assumed to be aprescribed ratio). In any case, gain (Gri, Ggi, Gbi) for correcting theinput feature value regarding each of R, G, B (where i signifies eachdetected subject type) is calculated with regard to each of the subjecttypes detected.

The color-conversion-condition synthesizing circuit 14 will be describednext.

The color-conversion-condition synthesizing circuit 14 is a circuit thatuses the subject type-by-type gain (Gri, Ggi, Gbi) supplied from thesubject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13 and the subject type-by-type degree Wi ofimportance entered from the input unit 2 to calculate a new gain(“applicable gain”) such that the input feature values regarding eachsubject type will approach overall the target feature values regardingeach subject type.

The color-conversion-condition synthesizing circuit 14 calculatesapplicable gain (Gr, Gg, Gb) according to the following equations basedupon subject type-by-type gains (Gri, Ggi, Gbi) supplied from thesubject type-by-type target feature-value/color-conversion-conditioncalculating circuit 13 and the subject type-by-type degree Wi ofimportance entered by the operator from the input unit 2:Gr=Σ(Wi·Gri)/ΣWiGg=Σ(Wi·Ggi)/ΣWi  Equation 6Gb=Σ(Wi·Gbi)/ΣWiApplicable gain calculated by the color-conversion-conditionsynthesizing circuit 14 will be described using a graph. FIG. 11 a is agraph illustrating input-output relationships (gain functions) for the Rcomponent with regard to an input image that contains the feature type“night scene” and the feature type “face”. These input-output functionsare represented by gains for the R component regarding respective onesof the feature types “night scene” and “face” calculated in the subjecttype-by-type target feature-value/color-conversion-condition calculatingcircuit 13. It should be noted that with regard to the subject type“night scene”, an input feature value and a target feature value areobtained with regard to each of shadow and highlight (see FIG. 7). Inthe graph illustrated in FIG. 11 a, the input feature value and targetfeature value regarding the subject type “night scene” (shadow) areindicated by the black circle, and the input feature value and targetfeature value regarding the subject type “night scene” (highlight) areindicated by the white circle. The input feature value and targetfeature value regarding the subject type “face” is indicated by thetriangle.

An input-output relationship (gain function) decided by applicable gainGr regarding the R component obtained by applying Equation 6 indicatedabove is illustrated in FIG. 11 b. The result of taking the weightedaverage of the gain (Gri, Ggi, Gbi), which is obtained for every subjecttype, by applying Equation 6 is adopted as applicable gain (Gr, Gg, Gb)to be applied to the input image data. Applicable gain (Gr, Gg, Gb)whereby each input feature value regarding each detected subject typewill approach overall each corresponding target feature value isobtained. Further, since the weighted average conforms to the degree Wiof importance that is input by the operator, the applicable gain morestrongly reflects the gain regarding the subject type that the operatoremphasizes.

The applicable gain (Gr, Gg, Gb) that is calculated by thecolor-conversion-condition synthesizing circuit 14 is applied to theimage correcting circuit 15. Using the applicable gain (Gr, Gg, Gb), theimage correcting circuit 15 corrects the RGB values of every pixelconstituting the image represented by the image data that has been readfrom the storage unit 4. The corrected image data is output from theimage processing apparatus 1 and applied to the display unit 3 orprinter 5.

First Modification

It may be so arranged that in addition to the processing according tothe embodiment described above, a user's request is accepted using theinput unit 2 and display unit 3 and detection accuracy and targetfeature value (gain) for each subject type are modified. FIG. 12illustrates an example of a screen, which is for inputting a user'swish, displayed on the display screen of the display unit 3.

The input unit 2 is used to select any one of “PRINT—EMPHASIZEPRODUCTIVITY”, “PRINT—EMPHASIZE QUALITY”, “PHOTOGRAPH—EMPHASIZEPRODUCTIVITY” and “PHOTOGRAPH—EMPHASIZE QUALITY”. Processing in theimage processing apparatus 1 changes in line with the user's selection(wish).

If the user selects “PRINT—EMPHASIZE QUALITY” or “PHOTOGRAPH—EMPHASIZEQUALITY”, processing in the image processing apparatus 1 is executed insuch a manner that it is possible to obtain a correction result having ahigher quality in comparison with a case where “PRINT—EMPHASIZEPRODUCTIVITY” or “PHOTOGRAPH—EMPHASIZE PRODUCTIVITY” is selected. Forexample, even in a case where area ratio (see step 34 in FIG. 4), whichis used in determining whether the subject type “face” is contained inthe input image, is revised to a small value and, as a result, a faceimage having a smaller area is contained in the input image, it isdetermined that the input image contains the subject type “face”. Thatis, detection can be performed down to smaller-size faces. Conversely,if “PRINT—EMPHASIZE PRODUCTIVITY” or “PHOTOGRAPH—EMPHASIZE PRODUCTIVITY”is selected, processing that emphasizes processing speed is executed inthe image processing apparatus 1.

Further, if the user selectes “PHOTOGRAPH—EMPHASIZE PRODUCTIVITY” or“PHOTOGRAPH—EMPHASIZE QUALITY”, gain is adjusted in such a manner thatthe slope of the gain function (see FIG. 11 b) is enlarged in comparisonwith a case where “PRINT—EMPHASIZE PRODUCTIVITY” or “PRINT—EMPHASIZEQUALITY” is selected.

Second Modification

FIG. 13, which shows another modification (second modification) of thefirst embodiment, is a block diagram illustrating the electricalstructure of the image processing apparatus 1 corresponding to FIG. 2,described above, as well as the storage unit 4.

In the second modification, subject information is input from the inputunit 2 and applied to the subject-type detecting circuit 11. The subjectinformation that is input from the input unit 2 is, e.g., informationrelating to whether or not each subject type exists in the input imageand data representing the position, etc., at which a subject type existsin the input image.

By way of example, assume that it is known beforehand (that the operatorof the image processing system has ascertained) that the subject type“face” does not exist in an input image to be subjected to imageprocessing. In this case, there is no need for processing for detectingthe subject type “face” in the subject-type detecting circuit 11,processing for calculating an input feature value regarding the subjecttype “face” in the subject type-by-type input feature-value calculatingcircuit 12, and processing for calculating a target feature value andgain regarding the subject type “face” in the subject type-by-typetarget feature-value/color-conversion-condition calculating circuit 13.If the subject-type information supplied from the input unit 2 to thesubject-type detecting circuit 11 contains data indicative of the factthat the subject type “face” does not exist, then the subject-typedetecting circuit 11 does not execute detection processing regarding thesubject type “face”, and processing regarding the subject type “face”also is not executed in the subject type-by-type input feature-valuecalculating circuit 12 and subject type-by-type targetfeature-value/color-conversion-condition calculating circuit 13. As aresult, the processing speed of the image processing apparatus 1 can beraised and so can the accuracy of applicable gain finally obtained.

In a case where it is known beforehand that the subject type “face”, forexample, exists in an input image to be subjected to image processing,the area in which the subject type “face” exists in the input image [theposition (area) of the face in the input image] may be incorporated inthe subject information that is input from the input unit 2. In thiscase also the subject-type detecting circuit 11 does not executedetection processing regarding the subject type “face”. Further, thesubject type-by-type input feature value calculating circuit 12 extractspixels, which are contained in the area (designated area) of existenceof the subject type “face” supplied from the input unit 2, from theinput image as pixels (face pixels) regarding the subject type “face”(the processing of step 32 in FIG. 4 is skipped).

In a case where input image data contains tag information and the taginformation contains information relating to the absence or presence ofa subject type (absence or presence of the subject type “face”), it maybe so arranged that the image processing apparatus 1 is controlled basedupon the tag information instead of the subject information that entersfrom the input unit 2.

Second Embodiment

FIG. 14 is a block diagram illustrating the electrical structure of animage processing apparatus 1A according to a second embodiment, as wellas the storage unit 4. This apparatus differs from the image processingapparatus 1 of the first embodiment (FIG. 2) in that a subjecttype-by-type existence-probability calculating circuit 51 is providedinstead of the subject-type detecting circuit 11. It also differs fromthe image processing apparatus 1 of the first embodiment in that anexistence-probability calculation table 52 is provided instead of thedetection condition table 21.

FIG. 15 is a functional block diagram illustrating the functions of thesubject type-by-type existence-probability calculating circuit 51,subject type-by-type input feature-value calculating circuit 12 andsubject type-by-type target feature-value calculatingcircuit/color-conversion-condition calculating circuit 13.

The subject type-by-type existence-probability calculating circuit 51 isa circuit for calculating, for every predetermined subject type, theprobability of existence in the input image (probability, degree ofconfidence or degree of certainty with which it is estimated that thesubject type exists).

The subject type-by-type existence-probability calculating circuit 51calculates whether the seven subject types “blue sky”, “sunset scene”,“face”, “high saturation”, “underwater”, “high key” and “night scene”are contained in the input image and, if a subject type is contained inthe input image, calculates to what degree of probability (confidence,certainty) the subject type is contained (function blocks 51 a to 51 gin FIG. 15). Furthermore, if the input image does not contain any of theseven subject types mentioned above (this will be referred to as thesubject type “outside scope of detection” below), the subjecttype-by-type existence-probability calculating circuit 51 alsocalculates the probability (confidence, certainty) that this will be so.(function block 51 h in FIG. 15).

FIG. 16 illustrates the content of the existence-probability calculationtable 52 used in calculating existence probability in the subjecttype-by-type existence-probability calculating circuit 51.

Types of features to be used in calculation of existence probabiity andidentification points have been stored in the existence-probabilitycalculation table 52 in correspondence with respective ones of the sevensubject types “blue sky”, “sunset scene”, “face”, “high saturation”,“underwater”, “high key” and “night scene”.

The data stored in the existence-probability calculation table 52 (thefeature types and identification points to be used in calculation ofexistence probability) is obtained by learning processing.

With reference to FIG. 17, in learning processing regarding the subjecttype “underwater”, first a plurality of images that contain the subjecttype “underwater” (referred to as “underwater sample images”) and aplurality of images that do not contain the subject type “underwater”(referred to as “non-underwater images”) are prepared (see the left sideof FIG. 17). Then, one feature value type, e.g., R-value average, isselected, the selected feature value type (R-value average) iscalculated using the plurality of underwater sample images, and afrequency histogram thereof is created. Similarly, the selected featurevalue type (R-value average) is calculated using the plurality ofnon-underwater sample images and a frequency histogram thereof iscalculated (see the center of FIG. 17).

If there is a frequency-histogram offset conforming to the values of afeature between the frequency histogram created using the plurality ofunderwater sample images and the frequency histogram created using theplurality of non-underwater sample images, then it can be construed thatthe selected feature value type is a feature value type suitable fordistinguishing between an underwater sample image and a non-underwatersample image. Logarithmic values of ratios of correspondingfeature-value-to-feature-value frequency values of the two createdhistograms are calculated. The calculated logarithmic values are“identification points” (see the right side of FIG. 17).

With regard to the input image data, the subject type-by-typeexistence-probability calculating circuit 51 calculates the featurevalues regarding the feature value types that have been stored in theexistence-probability calculation table 52 and acquires theidentification points corresponding to the feature values calculated. Ifan acquired identification point is a positive identification point,then there is a good possibility that the input image is an underwaterimage, and it can be said that the greater the absolute value of thisvalue, the greater the possibility. Conversely, if the acquiredidentification point is a negative identification point, then there is agood possibility that the input image does not contain an underwaterimage, and it can be said that the greater the absolute value of thisvalue, the greater the possibility.

Using the data that has been stored in the existence-probabilitycalculation table 52, the subject type-by-type existence-probabilitycalculating circuit 51 calculates existence probabilities (theabove-mentioned identification points or values of 0 to 1 that are basedon the identification points) regarding respective ones of the sevensubject types “blue sky”, “sunset scene”, “face”, “high saturation”,“underwater”, “high key” and “night scene”. The existence probability ofthe subject type “outside scope of detection” is calculated according tothe following equation:Pot=1−MAX(1−P ₁ , P ₂ , . . . ,P ₇)  Equation 7

Here P₁, P₂, . . . , P₇ represent existence probabilities regardingrespective ones of the seven subject types “blue sky”, “sunset scene”,“face”, “high saturation”, “underwater”, “high key” and “night scene”,and MAX(1−P₁, P₂, . . . , P₇) represents the maximum value among P₁, P₂,. . . , P₇.

The existence probabilities regarding the seven subject types “bluesky”, “sunset scene”, “face”, “high saturation”, “underwater”, “highkey” and “night scene” and the existence probability regarding thesubject type “outside scope of detection”, which probabilities have beencalculated by the subject type-by-type existence-probability calculatingcircuit 51, are used in the above-described weighting processing(Equation 6).

That is, in the image processing apparatus 1A of the second embodiment,the following unified importance degree Wa is used instead of theimportance degree Wi (see Equation 6) of the first embodiment:Wa=Wi·Wpi  Equation (8)

Here Wpi is a numerical value (degree of importance dependent uponexistence probability) conforming to each existence probability pi, ofevery detected subject type, obtained by the subject type-by-typeexistence-probability calculating circuit 51. For example, the Wpi iscalculated based upon a graph (conversion graph) illustrated in FIG. 18.In the image processing apparatus 1A of the second embodiment, theapplicable gain (Gr, Gg, Gb) applied to correction of the input imagedata more strongly reflects the gain regarding the subject type that theoperator emphasizes and more strongly reflects the gain regarding thesubject type having a high probability of existing in the input image.

Of course, the conversion graph illustrated in FIG. 18 may be made todiffer for every subject type.

It may be so arranged that the above-mentioned unified importance degreeWa is found according to the following equation:Wa=Wi·Wpi·Wsi  Equation 9

Here Wsi is a value (degree of importance dependent upon area) that isbased upon the area of the input image occupied by each detected subjecttype. Gain regarding a subject type occupying a larger area in the inputimage is more strongly reflected in the applicable gain.

In the second embodiment as well, in a manner similar to that of thefirst modification of the first embodiment, it will suffice to changeprocessing in the image processing apparatus 1 in line with the wish ofthe user relating to image correction. In a manner similar to that ofthe second modification of the first embodiment, it may be so arrangedthat the processing in the image processing apparatus 1A is supportedbased upon externally applied subject information (information, etc.,relating to the absence or presence of each subject type in the inputimage).

Although the image processing apparatuses 1, 1A are implemented byhardware circuits in the first and second embodiments, it may be soarranged that a part or the entirety thereof is implemented by software.

1. An image correction apparatus comprising: importance input means foraccepting inputs of first degrees of importance regarding respectiveones of a predetermined plurality of subject types; subject-typedetecting means for detecting, based upon image data applied thereto,which subject types among the predetermined plurality of subject typesare contained in the image represented by this image data; input featurevalue calculating means for calculating, based upon the image data andwith regard to respective ones of the subject types detected by saidsubject-type detecting means, input feature values by calculationprocessing decided for every subject type; correction value calculatingmeans for calculating correction values regarding respective ones of thedetected subject types based upon the input feature values calculated bysaid input feature value calculating means and target feature valuesthat has been decided for every subject type; subject type-by-typeexistence-probability calculating means for calculating existenceprobabilities representing to what degrees of confidence respective onesof images representing the plurality of subject types are contained inthe image represented by the image data, the calculation being performedfor every subject type of the plurality thereof;applicable-correction-value calculating means for calculating anapplicable correction value obtained by weighted averaging of thecorrection values regarding respective ones of the subject types, whichcorrection values have been calculated by said correction valuecalculating means, using the first degrees of importance accepted withregard to respective ones of the subject types by said importance inputmeans and second degrees of importance obtained in accordance with theexistence probabilities of respective ones of the subject typescalculated by said existence-probability calculating means; imagecorrecting means for correcting the image data based upon the applicablecorrection value calculated by said applicable-correction-valuecalculating means; and an input means for inputting subject informationindicating that a specific subject type among the predeterminedplurality of subject types does not exist in the image represented bysaid image data, wherein the image correction apparatus skips at leastthe detecting by the subject-type detecting means, the calculating bythe input feature value calculating means, the calculating by thecorrection value calculating means, and the calculating by the subjecttype-by-type existence-probability calculating means for the specificsubject type.
 2. The image correction apparatus according to claim 1,further comprising subject type-by-type area calculating means forcalculating, for every detected subject type, the area that an imagerepresenting the subject type occupies in the image represented by theimage data; wherein said applicable-correction-value calculating meansweights and averages the correction values regarding respective ones ofthe subject types, which correction values have been calculated by saidcorrection value calculating means, using the first degrees ofimportance and third degrees of importance obtained in accordance withthe areas regarding respective ones of the subject types calculated bysaid area calculating means.
 3. The image correction apparatus accordingto claim 1, further comprising: parameter input means for acceptinginput of a parameter that changes the target feature value; and targetfeature value modifying means for modifying the target feature valuebased upon the parameter input by said parameter input means.
 4. Animage correction method comprising: accepting inputs of first degrees ofimportance regarding respective ones of a predetermined plurality ofsubject types; detecting, based upon applied image data, which subjecttypes among a predetermined plurality of subject types are contained inthe image represented by this image data; calculating, based upon theimage data and with regard to respective ones of the detected subjecttypes, input feature values by calculation processing decided for everysubject type; calculating correction values regarding respective ones ofthe detected subject types based upon the calculated input feature valueand target feature values that has been decided for every subject type;calculating subject type-by-type existence-probability valuerepresenting to what degrees of confidence respective ones of imagesrepresenting the plurality of subject types are contained in the imagerepresented by the image data, the calculation being performed for everysubject type of the plurality thereof; calculating an applicablecorrection value obtained by weighted averaging of the calculatedcorrection values regarding respective ones of the subject types usingthe first degrees of importance accepted with regard to respective onesof the subject types and second degrees of importance obtained inaccordance with the existence probabilities of respective ones of thesubject types calculated by said existence-probability calculation;correcting the image data based upon the applicable correction valuecalculated; inputting subject information indicating that a specificsubject type among the predetermined plurality of subject types does notexist in the image represented by said image data; and skipping at leastthe detecting the subject-type, the calculating the input feature value,the calculating the correction value, and the calculating the subjecttype-by-type existence-probability for the specific subject type.
 5. Anon-transitory computer readable medium encoded with a program forcausing a computer to execute the following processing: importance inputprocessing for accepting inputs of first degrees of importance regardingrespective ones of a predetermined plurality of subject types;subject-type detection processing for detecting, based upon image dataapplied thereto, which subject types among the predetermined pluralityof subject types are contained in the image represented by this imagedata; input feature value calculation processing for calculating, basedupon the image data and with regard to respective ones of the detectedsubject types, input feature values by calculation processing decidedfor every subject type; correction value calculation processing forcalculating correction values regarding respective ones of the detectedsubject types based upon the detected input feature values and targetfeature values that has been decided for every subject type; calculatingsubject by subject existence probabilities representing to what degreesof confidence respective ones of images representing the plurality ofsubject types are contained in the image represented by the image data,the calculation being performed for every subject type of the pluralitythereof; applicable-correction-value calculation processing forcalculating an applicable correction value obtained by weightedaveraging of the calculated correction values regarding respective onesof the subject types, using the first degrees of importance acceptedwith regard to respective ones of the subject types by said importanceinput processing and second degrees of importance obtained in accordancewith the existence probabilities of respective ones of the subject typescalculated by said existence-probability calculation; image correctionprocessing for correcting the image data based upon the applicablecorrection value calculated; and input processing for inputting subjectinformation indicating that a specific subject type among thepredetermined plurality of subject types does not exist in the imagerepresented by said image data, wherein the program skips at least thesubject-type detection processing, the input feature value calculationprocessing, the correction value calculation processing, and the subjecttype-by-type existence-probability calculation processing for thespecific subject type.
 6. An image correction apparatus comprising:importance input means for accepting inputs of first degrees ofimportance regarding respective ones of a predetermined plurality ofsubject types; subject-type detecting means for detecting, based uponimage data applied thereto, which subject types among the predeterminedplurality of subject types are contained in the image represented bythis image data; input feature value calculating means for calculating,based upon the image data and with regard to respective ones of thesubject types detected by said subject-type detecting means, inputfeature value by calculation processing decided for every subject type;condition judging means for judging whether the input feature value ofevery subject type calculated by said input feature value calculatingmeans satisfies a prescribed condition that has been decided for everysubject type; correction value calculating means for calculating acorrection value with regard to a subject type for which the inputfeature value has been judged not to satisfy the prescribed condition bysaid condition judging means, the correction value being such that theinput feature value regarding this subject type will come to satisfy theprescribed condition; subject type-by-type existence-probabilitycalculating means for calculating existence probabilities representingto what degrees of confidence respective ones of images representing theplurality of subject types are contained in the image represented by theimage data, the calculation being performed for every subject type ofthe plurality thereof; applicable-correction-value calculating means forcalculating an applicable correction value obtained by weightedaveraging of the correction values regarding respective ones of thesubject types, which correction values have been calculated by saidcorrection value calculating means, using the first degrees ofimportance accepted with regard to respective ones of the subject typesby said importance input means and second degrees of importance obtainedin accordance with the existence probabilities of respective ones of thesubject types calculated by said existence-probability calculatingmeans; image correcting means for correcting the image data based uponthe applicable correction value calculated by saidapplicable-correction-value calculating means; and an input means forinputting subject information indicating that a specific subject typeamong the predetermined plurality of subject types does not exist in theimage represented by said image data, wherein the image correctionapparatus skips at least the detecting by the subject-type detectingmeans, the calculating by the input feature value calculating means, thecalculating by the correction value calculating means, and thecalculating by the subject type-by-type existence-probabilitycalculating means for the specific subject type.
 7. An image correctionmethod comprising: accepting inputs of first degrees of importanceregarding respective ones of a predetermined plurality of subject types;detecting, based upon applied image data, which subject types among apredetermined plurality of subject types are contained in the imagerepresented by this image data; calculating, based upon the image dataand with regard to respective ones of the detected subject types, inputfeature values by calculation processing decided for every subject type;judging whether the input feature value of every calculated subject typesatisfies a prescribed condition that has been decided for every subjecttype; calculating a correction value with regard to a subject type forwhich the input feature value has been judged not to satisfy theprescribed condition, the correction value being such that the inputfeature value regarding this subject type will come to satisfy theprescribed condition; calculating subject by subject existenceprobabilities representing to what degrees of confidence respective onesof images representing the plurality of subject types are contained inthe image represented by the image data, the calculation being performedfor every subject type of the plurality thereof; calculating anapplicable correction value obtained by weighted averaging of thecalculated correction values regarding respective ones of the subjecttypes using the first degrees of importance accepted with regard torespective ones of the subject types and second degrees of importanceobtained in accordance with the existence probabilities of respectiveones of the subject types calculated by said existence-probabilitycalculation; correcting the image data based upon the applicablecorrection value calculated; inputting subject information indicatingthat a specific subject type among the predetermined plurality ofsubject types does not exist in the image represented by said imagedata; and skipping at least the detecting the subject-type, thecalculating the input feature value, the calculating the correctionvalue, and the calculating the subject type-by-typeexistence-probability for the specific subject type.
 8. A non-transitorycomputer readable medium encoded with a program for causing a computerto execute the following processing: importance input processing foraccepting inputs of first degrees of importance regarding respectiveones of a predetermined plurality of subject types; subject-typedetection processing for detecting, based upon image data appliedthereto, which subject types among the predetermined plurality ofsubject types are contained in the image represented by this image data;input feature value calculation processing for calculating, based uponthe image data and with regard to respective ones of the detectedsubject types, input feature values by calculation processing decidedfor every subject type; condition judgment processing for judgingwhether the input feature value of every subject type calculated by saidinput feature value calculation processing satisfies a prescribedcondition that has been decided for every subject type; correction valuecalculation processing for calculating a correction value with regard toa subject type for which the input feature value has been judged not tosatisfy the prescribed condition by said condition judgment processing,the correction value being such that the input feature value regardingthis subject type will come to satisfy the prescribed condition;calculating subject by subject existence probabilities representing towhat degrees of confidence respective ones of images representing theplurality of subject types are contained in the image represented by theimage data, the calculation being performed for every subject type ofthe plurality thereof; applicable-correction-value calculationprocessing for calculating an applicable correction value obtained byweighted averaging of the correction values regarding respective ones ofthe subject types, which correction values have been calculated by saidcorrection value calculation processing, using the first degrees ofimportance accepted with regard to respective ones of the subject typesby said importance input processing and second degrees of importanceobtained in accordance with the existence probabilities of respectiveones of the subject types calculated by said existence-probabilitycalculation; image correction processing for correcting the image databased upon the applicable correction value calculated by saidapplicable-correction-value calculation processing; and input processingfor inputting subject information indicating that a specific subjecttype among the predetermined plurality of subject types does not existin the image represented by said image data, wherein the program skipsat least the subject-type detection processing, the input feature valuecalculation processing, the correction value calculation processing, andthe subject type-by-type existence-probability calculation processingfor the specific subject type.
 9. An image correction apparatuscomprising: importance input device for accepting inputs of firstdegrees of importance regarding respective ones of a predeterminedplurality of subject types; subject-type detecting device for detecting,based upon image data applied thereto, which subject types among thepredetermined plurality of subject types are contained in the imagerepresented by this image data; input feature value calculating devicefor calculating, based upon the image data and with regard to respectiveones of the subject types detected by said subject-type detectingdevice, input feature values by calculation processing decided for everysubject type; correction value calculating device for calculatingcorrection values regarding respective ones of the detected subjecttypes based upon the input feature values calculated by said inputfeature value calculating device and target feature values that has beendecided for every subject type; subject type-by-typeexistence-probability calculating device for calculating existenceprobabilities representing to what degrees of confidence respective onesof images representing the plurality of subject types are contained inthe image represented by the image data, the calculation being performedfor every subject type of the plurality thereof;applicable-correction-value calculating device for calculating anapplicable correction value obtained by weighted averaging of thecorrection values regarding respective ones of the subject types, whichcorrection values have been calculated by said correction valuecalculating device, using the first degrees of importance accepted withregard to respective ones of the subject types by said importance inputdevice and second degrees of importance obtained in accordance with theexistence probabilities of respective ones of the subject typescalculated by said existence-probability calculating device; imagecorrecting device for correcting the image data based upon theapplicable correction value calculated by saidapplicable-correction-value calculating device; and an input device forinputting subject information indicating that a specific subject typeamong the predetermined plurality of subject types does not exist in theimage represented by said image data, wherein the image correctionapparatus skips at least the detecting by the subject-type detectingdevice, the calculating by the input feature value calculating device,the calculating by the correction value calculating device, and thecalculating by the subject type-by-type existence-probabilitycalculating device for the specific subject type.
 10. An imagecorrection apparatus comprising: importance input device for acceptinginputs of first degrees of importance regarding respective ones of apredetermined plurality of subject types; subject-type detecting devicefor detecting, based upon image data applied thereto, which subjecttypes among the predetermined plurality of subject types are containedin the image represented by this image data; input feature valuecalculating device for calculating, based upon the image data and withregard to respective ones of the subject types detected by saidsubject-type detecting device, input feature value by calculationprocessing decided for every subject type; condition judging device forjudging whether the input feature value of every subject type calculatedby said input feature value calculating device satisfies a prescribedcondition that has been decided for every subject type; correction valuecalculating device for calculating a correction value with regard to asubject type for which the input feature value has been judged not tosatisfy the prescribed condition by said condition judging device, thecorrection value being such that the input feature value regarding thissubject type will come to satisfy the prescribed condition; subjecttype-by-type existence-probability calculating device for calculatingexistence probabilities representing to what degrees of confidencerespective ones of images representing the plurality of subject typesare contained in the image represented by the image data, thecalculation being performed for every subject type of the pluralitythereof; applicable-correction-value calculating device for calculatingan applicable correction value obtained by weighted averaging of thecorrection values regarding respective ones of the subject types, whichcorrection values have been calculated by said correction valuecalculating device, using the first degrees of importance accepted withregard to respective ones of the subject types by said importance inputdevice and second degrees of importance obtained in accordance with theexistence probabilities of respective ones of the subject typescalculated by said existence-probability calculating device; imagecorrecting device for correcting the image data based upon theapplicable correction value calculated by saidapplicable-correction-value calculating device; and an input device forinputting subject information indicating that a specific subject typeamong the predetermined plurality of subject types does not exist in theimage represented by said image data, wherein the image correctionapparatus skips at least the detecting by the subject-type detectingdevice, the calculating by the input feature value calculating device,the calculating by the correction value calculating device, and thecalculating by the subject type-by-type existence-probabilitycalculating device for the specific subject type.
 11. The apparatus ofclaim 1, wherein the importance input means accepts input supplied by auser to specify the user's perception of degree of importance.